<?php
$str = "/usr/home/byu3274120001/htdocs/uploads/20180731";
echo substr($str, strripos($str, "htdocs") + 6);
?>